Fixup tests
authorNick Cameron <ncameron@mozilla.com>
Tue, 3 Jan 2017 21:22:58 +0000 (10:22 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 5 Jan 2017 00:40:41 +0000 (13:40 +1300)
tests/build-lib.rs
tests/build-script.rs
tests/build.rs
tests/check.rs
tests/cross-compile.rs
tests/profiles.rs
tests/run.rs
tests/rustc.rs

index 5fad077a0b9d8445961e518d80b6df5f6383323d..39fb7c4842fe674fa215696d1ace64f00048fe3c 100644 (file)
@@ -7,10 +7,10 @@ use hamcrest::{assert_that};
 fn verbose_output_for_lib(p: &ProjectBuilder) -> String {
     format!("\
 [COMPILING] {name} v{version} ({url})
-[RUNNING] `rustc --crate-name {name} src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name {name} src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ",
index a96d03ae6b485254cdd49dada5e599a3cdaa5c6e..35606cbb1fdcd220e65b4703dbd42e193b3ad608 100644 (file)
@@ -765,19 +765,22 @@ fn build_cmd_with_a_build_cmd() {
 [COMPILING] a v0.5.0 (file://[..])
 [RUNNING] `rustc [..] a[/]build.rs [..] --extern b=[..]`
 [RUNNING] `[..][/]a-[..][/]build-script-build`
-[RUNNING] `rustc --crate-name a [..]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name a [..]lib.rs --crate-type lib \
+    --emit=dep-info,link -g \
     -C metadata=[..] \
-    --out-dir [..]target[/]debug[/]deps --emit=dep-info,link \
+    --out-dir [..]target[/]debug[/]deps \
     -L [..]target[/]debug[/]deps`
 [COMPILING] foo v0.5.0 (file://[..])
 [RUNNING] `rustc --crate-name build_script_build build.rs --crate-type bin \
-    -g -C metadata=[..] --out-dir [..] --emit=dep-info,link \
+    --emit=dep-info,link \
+    -g -C metadata=[..] --out-dir [..] \
     -L [..]target[/]debug[/]deps \
     --extern a=[..]liba[..].rlib`
 [RUNNING] `[..][/]foo-[..][/]build-script-build`
-[RUNNING] `rustc --crate-name foo [..]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo [..]lib.rs --crate-type lib \
+    --emit=dep-info,link -g \
     -C metadata=[..] \
-    --out-dir [..] --emit=dep-info,link \
+    --out-dir [..] \
     -L [..]target[/]debug[/]deps`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 "));
index 7b19633b994c54c8b11365ad062dda49911aa153..4ab8706cebb635317f3cbdc3c0668838f99d41d0 100644 (file)
@@ -794,21 +794,20 @@ fn cargo_default_env_metadata_env_var() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] bar v0.0.1 ({url}/bar)
 [RUNNING] `rustc --crate-name bar bar[/]src[/]lib.rs --crate-type dylib \
+        --emit=dep-info,link \
         -C prefer-dynamic -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         -C extra-filename=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps \
         --extern bar={dir}[/]target[/]debug[/]deps[/]{prefix}bar{suffix}`
-[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-",
+[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]",
 dir = p.root().display(),
 url = p.url(),
 prefix = env::consts::DLL_PREFIX,
@@ -822,17 +821,17 @@ suffix = env::consts::DLL_SUFFIX,
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] bar v0.0.1 ({url}/bar)
 [RUNNING] `rustc --crate-name bar bar[/]src[/]lib.rs --crate-type dylib \
+        --emit=dep-info,link \
         -C prefer-dynamic -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         -C extra-filename=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps \
         --extern bar={dir}[/]target[/]debug[/]deps[/]{prefix}bar-[..]{suffix}`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
@@ -1142,11 +1141,11 @@ fn lto_build() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]main.rs --crate-type bin \
+        --emit=dep-info,link \
         -C opt-level=3 \
         -C lto \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]release[/]deps \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps`
 [FINISHED] release [optimized] target(s) in [..]
 ",
@@ -1170,10 +1169,10 @@ fn verbose_build() {
     assert_that(p.cargo_process("build").arg("-v"),
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
-[RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ",
@@ -1198,10 +1197,10 @@ fn verbose_release_build() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level=3 \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps`
 [FINISHED] release [optimized] target(s) in [..]
 ",
@@ -1241,18 +1240,19 @@ fn verbose_release_build_deps() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] foo v0.0.0 ({url}/foo)
 [RUNNING] `rustc --crate-name foo foo[/]src[/]lib.rs \
-        --crate-type dylib --crate-type rlib -C prefer-dynamic \
+        --crate-type dylib --crate-type rlib \
+        --emit=dep-info,link \
+        -C prefer-dynamic \
         -C opt-level=3 \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps`
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level=3 \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps \
         --extern foo={dir}[/]target[/]release[/]deps[/]{prefix}foo{suffix} \
         --extern foo={dir}[/]target[/]release[/]deps[/]libfoo.rlib`
index d62ae20d2d748c359874aa1c9b1663df6a08ef5a..cf039898d438e63de8b531e04f9cfdd0a3132494 100644 (file)
@@ -244,7 +244,7 @@ fn issue_3418() {
 
     assert_that(foo.cargo_process("check").arg("-v"),
                 execs().with_status(0)
-                       .with_stderr_does_not_contain("--crate-type lib"));
+                       .with_stderr_contains("[..] --emit=dep-info,metadata [..]"));
 }
 
 // Some weirdness that seems to be caused by a crate being built as well as
index c8cdc4aa757dc0d7f4955a922ce9bcd9c8eab40b..859342ab7f8b6da3fb91e848fc1412f0e1583919 100644 (file)
@@ -357,10 +357,10 @@ fn linker_and_ar() {
                 execs().with_status(101)
                        .with_stderr_contains(&format!("\
 [COMPILING] foo v0.5.0 ({url})
-[RUNNING] `rustc --crate-name foo src[/]foo.rs --crate-type bin -g \
+[RUNNING] `rustc --crate-name foo src[/]foo.rs --crate-type bin \
+    --emit=dep-info,link -g \
     -C metadata=[..] \
     --out-dir {dir}[/]target[/]{target}[/]debug[/]deps \
-    --emit=dep-info,link \
     --target {target} \
     -C ar=my-ar-tool -C linker=my-linker-tool \
     -L dependency={dir}[/]target[/]{target}[/]debug[/]deps \
index cc3cf74039e828f03f7e2c44614601882d5a285a..7511e0228f17239feb58beddae039c05c9b510bb 100644 (file)
@@ -28,12 +28,12 @@ fn profile_overrides() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level=1 \
         -C debug-assertions=on \
         -C metadata=[..] \
         -C rpath \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] debug [optimized] target(s) in [..]
 ",
@@ -61,10 +61,10 @@ fn opt_level_override_0() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] [..] target(s) in [..]
 ",
@@ -91,12 +91,12 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level={level} \
         -g \
         -C debug-assertions=on \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] [..] target(s) in [..]
 ",
@@ -160,20 +160,21 @@ fn top_level_overrides_deps() {
                 execs().with_status(0).with_stderr(&format!("\
 [COMPILING] foo v0.0.0 ({url}/foo)
 [RUNNING] `rustc --crate-name foo foo[/]src[/]lib.rs \
-        --crate-type dylib --crate-type rlib -C prefer-dynamic \
+        --crate-type dylib --crate-type rlib \
+        --emit=dep-info,link \
+        -C prefer-dynamic \
         -C opt-level=1 \
         -g \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]release[/]deps \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps`
 [COMPILING] test v0.0.0 ({url})
 [RUNNING] `rustc --crate-name test src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level=1 \
         -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps \
         --extern foo={dir}[/]target[/]release[/]deps[/]\
                      {prefix}foo[..]{suffix} \
index 4e666086fadad8fc1fdce5ed6c71247b695f6da0..eaf879ddd2889acad6c32da2b28b5bce6fbfc6a9 100644 (file)
@@ -417,17 +417,17 @@ fn example_with_release_flag() {
                        .with_stderr(&format!("\
 [COMPILING] bar v0.0.1 ({url}/bar)
 [RUNNING] `rustc --crate-name bar bar[/]src[/]bar.rs --crate-type lib \
+        --emit=dep-info,link \
         -C opt-level=3 \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]release[/]deps \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps`
 [COMPILING] foo v0.0.1 ({url})
 [RUNNING] `rustc --crate-name a examples[/]a.rs --crate-type bin \
+        --emit=dep-info,link \
         -C opt-level=3 \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]release[/]examples \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]release[/]deps \
          --extern bar={dir}[/]target[/]release[/]deps[/]libbar-[..].rlib`
 [FINISHED] release [optimized] target(s) in [..]
@@ -445,17 +445,17 @@ fast2"));
                        .with_stderr(&format!("\
 [COMPILING] bar v0.0.1 ({url}/bar)
 [RUNNING] `rustc --crate-name bar bar[/]src[/]bar.rs --crate-type lib \
+        --emit=dep-info,link \
         -g \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]debug[/]deps \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [COMPILING] foo v0.0.1 ({url})
 [RUNNING] `rustc --crate-name a examples[/]a.rs --crate-type bin \
+        --emit=dep-info,link \
         -g \
         -C metadata=[..] \
         --out-dir {dir}[/]target[/]debug[/]examples \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps \
          --extern bar={dir}[/]target[/]debug[/]deps[/]libbar-[..].rlib`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
index 69e16a36a2fa351da57e713d70530436a2dac3bd..4a7a04d8cfcb91d01a332b40d2a86c33f5927e88 100644 (file)
@@ -27,10 +27,10 @@ fn build_lib_for_foo() {
                 .with_status(0)
                 .with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ", dir = p.root().display(), url = p.url())));
@@ -56,11 +56,11 @@ fn lib() {
                 .with_status(0)
                 .with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C debug-assertions=off \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ", dir = p.root().display(), url = p.url())))
@@ -86,16 +86,16 @@ fn build_main_and_allow_unstable_options() {
                 .with_status(0)
                 .with_stderr(&format!("\
 [COMPILING] {name} v{version} ({url})
-[RUNNING] `rustc --crate-name {name} src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name {name} src[/]lib.rs --crate-type lib \
+        --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps`
-[RUNNING] `rustc --crate-name {name} src[/]main.rs --crate-type bin -g \
+[RUNNING] `rustc --crate-name {name} src[/]main.rs --crate-type bin \
+        --emit=dep-info,link -g \
         -C debug-assertions \
         -C metadata=[..] \
         --out-dir [..] \
-        --emit=dep-info,link \
         -L dependency={dir}[/]target[/]debug[/]deps \
         --extern {name}={dir}[/]target[/]debug[/]deps[/]lib{name}-[..].rlib`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
@@ -151,10 +151,10 @@ fn build_with_args_to_one_of_multiple_binaries() {
                 .with_status(0)
                 .with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..]`
-[RUNNING] `rustc --crate-name bar src[/]bin[/]bar.rs --crate-type bin -g \
+[RUNNING] `rustc --crate-name bar src[/]bin[/]bar.rs --crate-type bin --emit=dep-info,link -g \
         -C debug-assertions [..]`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ", url = p.url())));
@@ -207,10 +207,10 @@ fn build_with_args_to_one_of_multiple_tests() {
                 .with_status(0)
                 .with_stderr(format!("\
 [COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib -g \
+[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib --emit=dep-info,link -g \
         -C metadata=[..] \
         --out-dir [..]`
-[RUNNING] `rustc --crate-name bar tests[/]bar.rs -g \
+[RUNNING] `rustc --crate-name bar tests[/]bar.rs --emit=dep-info,link -g \
         -C debug-assertions [..]--test[..]`
 [FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
 ", url = p.url())));